package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.OpenPlatformEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class UserRemindedInfoAddRequest extends Request {

	private int userId;//发起提醒用户
	private int followedUserId;//接收提醒用户
	private int dataType;
	private String content;//测量项目
	private int day;
	private int openPlatformId;
	private String message ;    //提醒留言
	
	public UserRemindedInfoAddRequest() {
	}

	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.followedUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followedUserId.getParamName(), 0);
		this.dataType = requestInfo.getIntParameter(ApiUrlParamEnum.dataType.getParamName(), 0);
		this.content = requestInfo.getParameter(ApiUrlParamEnum.content.getParamName(), "");
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), OpenPlatformEnum.WECHAT_HDC.getId());
		this.day = requestInfo.getIntParameter(ApiUrlParamEnum.day.getParamName(), 1);
		this.message = requestInfo.getParameter(ApiUrlParamEnum.message.getParamName(), "");
		if ( userId < 1 ) {
			throw new RequestIllegalException("error userId: " + userId);
		}
		if ( followedUserId < 1 ) {
			throw new RequestIllegalException("error followedUserId: " + followedUserId);
		}
		if ( dataType < 1 ) {
			throw new RequestIllegalException("error dataType: " + dataType);
		}
		if ( content.equals("") ) {
			throw new RequestIllegalException("error content: " + content);
		}
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getFollowedUserId() {
		return followedUserId;
	}

	public void setFollowedUserId(int followedUserId) {
		this.followedUserId = followedUserId;
	}

	public int getDataType() {
		return dataType;
	}

	public void setDataType(int dataType) {
		this.dataType = dataType;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(int openPlatformId) {
		this.openPlatformId = openPlatformId;
	}

	public int getDay() {
		return day;
	}

	public void setDay(int day) {
		this.day = day;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
}
